.config-page {
  padding: 20px;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  position: relative;
}

/* 添加背景装饰元素 */
.config-page::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 30%, var(--color-primary) 0%, transparent 20%),
              radial-gradient(circle at 70% 60%, var(--color-primary) 0%, transparent 20%),
              radial-gradient(circle at 40% 80%, var(--color-primary) 0%, transparent 15%),
              radial-gradient(circle at 80% 10%, var(--color-primary) 0%, transparent 15%);
  opacity: 0.1;
  z-index: -1;
  pointer-events: none;
  animation: backgroundMove 60s linear infinite;
}

@keyframes backgroundMove {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.rc-virtual-list-scrollbar-thumb {
  background-color: var(--color-primary) !important;
}
.config-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .config-page {
    margin-left: var(--sidebar-width, 160px);
    padding: 20px;
  }
  
  .config-page.sidebar-hidden {
    margin-left: 0;
  }
  
  /* 当侧边栏隐藏时调整内容最大宽度 */
  .config-page.sidebar-hidden .config-container {
    max-width: 100%;
  }

  .config-container {
    padding: 0;
    margin: 0;
  }
}

@media (max-width: 767px) {
  .config-page {
    padding: 16px;
  }
  
  .config-container {
    padding: 0;
  }

  .config-list {
    padding: 0 16px;
  }

  .header-buttons {
    padding: 0 16px;
  }
}

.config-header {
  margin-bottom: 20px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
}

.config-header .ant-btn {
  background: var(--color-primary) !important;
  color: white !important;
}
.config-header .ant-btn:hover {
  background: var(--color-primary) !important;
  color: white !important;
}
.config-header h2 {
  margin: 0;
  color: var(--color-text-primary);
}

.header-buttons {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.header-buttons .back-button {
  margin-right: auto;
  background: var(--color-background) !important;
  border: 1px solid var(--color-border) !important;
  color: var(--color-text-primary) !important;
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-buttons .global-config-button {
  background: var(--color-background) !important;
  border: 1px solid var(--color-border) !important;
  color: var(--color-text-primary) !important;
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-buttons .global-config-button:hover,
.header-buttons .back-button:hover {
  background: var(--color-background-secondary) !important;
  border-color: var(--color-primary) !important;
  color: var(--color-primary) !important;
}

.header-buttons button {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border: none;
  border-radius: var(--border-radius-small);
  background: var(--color-primary);
  color: white;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.header-buttons button:hover {
  background: var(--color-primary-dark);
}

.header-buttons .save-button {
  padding: 8px;
}

.header-buttons .save-button.has-changes {
  animation: pulse 2s infinite;
}

.header-buttons .import-button,
.header-buttons .export-button {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
}

.header-buttons .import-button:hover,
.header-buttons .export-button:hover {
  background: var(--color-card-bg);
  border-color: var(--color-primary);
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.save-button {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 28px;
  background: var(--color-primary);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s;
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
  z-index: 100;
}

.save-button.has-changes {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.add-card-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 28px;
  background: var(--color-primary);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s;
  z-index: 100;
}
@media (max-width: 767px) {
  .save-button {
    bottom: 150px;
    right: 10px;
  }
  .add-card-button {
    bottom: 80px;
    right: 10px;
  }
}

.loading-state {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.loading-state p {
  margin-top: 16px;
  color: var(--color-text);
}

.config-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 80px;
  width: 100%;
  box-sizing: border-box;
}

.config-card {
  min-height: 220px;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s;
  cursor: pointer;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  /* 默认样式（无毛玻璃效果时的后备方案） */
  background: var(--color-background);
  border: 1px solid var(--color-border);
}

.config-card:hover {
  transform: translateY(-2px);
}

/* 支持backdrop-filter的浏览器应用毛玻璃效果 */
@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
  .config-card {
    background: rgba(255, 255, 255, 0.12);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  }
  
  /* 悬停状态增强 */
  .config-card:hover {
    background: rgba(255, 255, 255, 0.18);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    border-color: var(--color-primary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  }
  
  /* 暗色模式下的毛玻璃效果 */
  @media (prefers-color-scheme: dark) {
    .config-card {
      background: rgba(30, 30, 30, 0.25);
      border: 1px solid rgba(255, 255, 255, 0.08);
    }
    
    .config-card:hover {
      background: rgba(30, 30, 30, 0.35);
    }
  }
}

/* 为卡片添加微妙的光泽效果 */
.config-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0.02)
  );
  border-radius: 12px 12px 0 0;
  pointer-events: none;
  z-index: 1;
}

/* 添加底部阴影效果 */
.config-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30%;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.05),
    transparent
  );
  border-radius: 0 0 12px 12px;
  pointer-events: none;
  z-index: 1;
}

/* 确保卡片内容在光泽效果之上 */
.card-header, .card-switches, .card-actions {
  position: relative;
  z-index: 2;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--color-primary);
  color: white;
  flex-shrink: 0;
}

/* 调整卡片标题颜色，确保在毛玻璃背景上可见 */
.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.card-switches {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

/* 调整开关项文本颜色 */
.switch-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--color-text);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

/* 自定义 Switch 样式 */
.switch-item .ant-switch {
  background: var(--color-border) !important;
}

.switch-item .ant-switch-checked {
  background: var(--color-primary) !important;
}

.card-actions {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

/* 自定义操作按钮样式 */
.card-actions .ant-btn {
  flex: 1;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--color-card-bg-transparent);
  border: 1px solid var(--color-card-bg-transparent);
  color: var(--color-text);
}

.card-actions .ant-btn:hover {
  background: var(--color-background-secondary);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.card-actions .ant-btn-dangerous {
  color: var(--color-error);
  border-color: var(--color-error);
}

.card-actions .ant-btn-dangerous:hover {
  background: var(--color-error);
  color: white;
  border-color: var(--color-error);
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.config-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
}

.config-preview:last-child {
  border-bottom: none;
}

.config-preview strong {
  color: var(--color-text-secondary);
  font-size: 13px;
}

.config-preview span {
  color: var(--color-text);
  font-size: 13px;
  word-break: break-all;
  max-width: 60%;
  text-align: right;
}

.preview-container {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 400px;
  height: 500px;
  background: var(--color-card-bg);
  border-radius: var(--border-radius-medium);
  box-shadow: 0 4px 12px var(--color-shadow);
  z-index: 10000000;
  overflow: hidden;
}

.preview-container.visible {
  display: block;
}

.close-preview {
  position: absolute;
  top: 20px;
  right: 12px;
  padding: 6px;
  border: none;
  border-radius: var(--border-radius-small);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.preview-container .light-overview-card {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.version-info {
  float: right;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-secondary);
  background: var(--color-background);
  padding: 4px 10px;
  border-radius: var(--border-radius-small);
  border: 1px solid var(--color-border);
  max-width: 250px;
  overflow: visible;
  white-space: nowrap;
  box-sizing: border-box;
  margin-top: 12px;
}

.version-info .ant-btn-link {
  color: var(--color-primary);
  font-size: 12px;
  height: auto;
  line-height: 1;
}

.version-info .ant-btn-link:hover {
  color: var(--color-primary-hover);
  background: var(--color-background-hover);
}

.webdav-button,
.sync-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  background-color: #4a5568;
  color: white;
  cursor: pointer;
}

.webdav-button:hover,
.sync-button:hover {
  background-color: #2d3748;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

.modal-buttons button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.modal-buttons button:first-child {
  background-color: #4299e1;
  color: white;
}

.modal-buttons button:last-child {
  background-color: #e2e8f0;
}
